package com.google.code.jholidays.events.properties;

import com.google.code.jholidays.core.EventDescriptor;
import com.google.code.jholidays.events.FixedEvent;
import com.google.code.jholidays.events.FixedEventFactory;
import com.google.code.jholidays.events.parameters.DayMonthPair;


/**
 * Encapsulates properties needed for construction of {@link FixedEvent}
 * instances
 * 
 * @author tillias
 * @see FixedEventFactory
 * @see FixedEvent
 * 
 */
public class FixedEventProperties extends AbstractEventProperties {

    /**
     * Creates new instance of properties
     * 
     * @param descriptor
     *            Event descriptor
     * @param pair
     *            Day and month indexes
     * @throws IllegalArgumentException
     *             Thrown if any parameter passed to constructor is null
     */
    public FixedEventProperties(EventDescriptor descriptor, DayMonthPair pair)
	    throws IllegalArgumentException {
	super(descriptor, null);

	if (pair == null)
	    throw new IllegalArgumentException("Day-month pair is null");

	this.pair = pair;
    }

    /**
     * Gets day and month indexes
     * 
     * @return Day and month indexes
     */
    public DayMonthPair getDayMonth() {
	return pair;
    }

    DayMonthPair pair;
}
